<template>
    <view class="page">
		<image class="bg" src="../../static/img/bg_index.jpg"></image>
		<view class="wrap">
			<view class="up">
				<view class="apply">
					<view class="tabs">
						<view @tap="switchTab(index)" :class="(index==selectTab)?'tab select':'tab'" v-for="(item,index) in tabList" :key="index">{{item}}</view>
					</view>
					<view class="form">
						<view class="tt">
							<image src="../../static/img/tt_want.png" class="want"></image>
							<view style="flex: 1;"></view>
							<view @tap="chooseJob" class="choose">请选择就业方向></view>
						</view>
						<view class="input">
							<picker @change="pickerChange" :value="preIdx" :range="preList">
								<view class="pre">{{preList[preIdx]}}</view>
							</picker>
							<image src="../../static/img/arr_down.png" class="arr_down"></image>
							<input maxlength="11" type="number" :value="phone" @input="inputPhone" class="phone" placeholder="请输入" placeholder-class="phone"/>
						</view>
						<view class="note">我们和国内外名企、园区具有长期而直接的合作，为各类学生就业以及在职人员职场提升服务。</view>
						<image @tap="doPlan" src="../../static/img/btn_plan_for_me.png" class="btn"></image>
					</view>
				</view>
				<view class="pro_tt">
					<image src="../../static/img/tt_project.png"></image>
				</view>
				<view class="project">
					<view v-for="(item,index) in proList" :key="index" class="item">
						<image class="img" :src="item.img"></image>
						<view class="name">{{item.name}}</view>
						<view class="desc">{{item.desc}}</view>
						<view class="price">¥ <text class="large">{{item.price}}</text> 起/人 ({{item.period}})</view>
					</view>
				</view>
			</view>
			
			<image @tap="go" src="../../static/img/bg_index_down.png" class="down"></image>
		</view>
    </view>
</template>

<script>
    import {
        mapState
    } from 'vuex'

    export default {
        data(){
			return{
				tabList:["求学","就业","研学","培训"],
				selectTab:1,
				preList:["+86","+87","+88"],
				preIdx:0,
				phone:"",
				proList:[{
					img:"http://imgsrc.baidu.com/forum/w%3D580/sign=4db619dcfd246b607b0eb27cdbf91a35/d785b1cc7cd98d10f2564bbe2a3fb80e7aec901c.jpg",
					name:"寻访迷人古老学府",
					desc:"剑桥大学克莱尔学院",
					price:"3.58万",
					period:"3周"
				},{
					img:"http://imgsrc.baidu.com/forum/w%3D580/sign=4db619dcfd246b607b0eb27cdbf91a35/d785b1cc7cd98d10f2564bbe2a3fb80e7aec901c.jpg",
					name:"寻访迷人古老学府",
					desc:"剑桥大学克莱尔学院",
					price:"3.58万",
					period:"3周"
				},{
					img:"http://imgsrc.baidu.com/forum/w%3D580/sign=4db619dcfd246b607b0eb27cdbf91a35/d785b1cc7cd98d10f2564bbe2a3fb80e7aec901c.jpg",
					name:"寻访迷人古老学府",
					desc:"剑桥大学克莱尔学院",
					price:"3.58万",
					period:"3周"
				},{
					img:"http://imgsrc.baidu.com/forum/w%3D580/sign=4db619dcfd246b607b0eb27cdbf91a35/d785b1cc7cd98d10f2564bbe2a3fb80e7aec901c.jpg",
					name:"寻访迷人古老学府",
					desc:"剑桥大学克莱尔学院",
					price:"3.58万",
					period:"3周"
				},{
					img:"http://imgsrc.baidu.com/forum/w%3D580/sign=4db619dcfd246b607b0eb27cdbf91a35/d785b1cc7cd98d10f2564bbe2a3fb80e7aec901c.jpg",
					name:"寻访迷人古老学府",
					desc:"剑桥大学克莱尔学院",
					price:"3.58万",
					period:"3周"
				}]
			}
		},
		methods:{
			switchTab(index){
				this.selectTab = index;
			},
			pickerChange(e){
				this.preIdx = e.detail.value;
			},
			inputPhone(e){
				this.phone = e.detail.value;
			},
			chooseJob(){
				console.log("选择就业方向")
			},
			doPlan(){
				uni.navigateTo({
					url:"../bind/bind"
				})
			},
			go(){
				uni.navigateTo({
					url:"../apply/apply"
				})
			}
		}
    }
</script>

<style scoped lang="less">
	.page{
		width: 100%;
		min-height: 100%;
		  margin: 0;
		  padding: 0;
		  position: relative;
	}
	.bg{
		z-index: -1;
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;left: 0;right: 0;bottom: 0;
	}
	.wrap{
		width: 100%;
		z-index: 10;
		display: flex;
		flex-direction: column;
		align-items: center;
		.up{
			margin-top: 40rpx;
			width: 670rpx;
			background: black;
			border-radius: 10rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			.apply{
				width: 626rpx;
				display: flex;
				flex-direction: column;
				margin-top: 34rpx;
				.tabs{
					width: 100%;
					height: 64rpx;
					display: flex;
					flex-direction: row;
					.tab{
						flex: 1;
						margin-right: 6rpx;
						text-align: center;
						height: 64rpx;
						line-height:64rpx;
						background: #8a7c5a;
						color: white;
						font-size: 28rpx;
						font-weight: bolder;
						border-top-left-radius: 10rpx;
						border-top-right-radius: 10rpx;
					}
					.tab:last-child{
						margin-right: 0;
					}
					.select{
						background: #FFFFFF;
						color: #8a7c5a;
					}
				}
				.form{
					width: 100%;
					display: flex;
					flex-direction: column;
					align-items: center;
					background: white;
					.tt{
						width: 550rpx;
						margin: 32rpx 0 0;
						display: flex;
						flex-direction: row;
						align-items: center;
						color: #8a7c5a;
						.want{
							width: 123rpx;
							height: 32rpx;
						}
						.choose{
							font-size: 22rpx;
						}
					}
					.input{
						width: 550rpx;
						margin: 50rpx 0 0;
						padding-bottom: 24rpx;
						display: flex;
						flex-direction: row;
						align-items: center;
						color: #000000;
						border-bottom: 1rpx solid #c3baa5;
						.pre{
							font-size: 36rpx;
							line-height: 36rpx;
							margin-right: 11rpx;
						}
						.arr_down{
							width: 14rpx;
							height: 9rpx;
						}
						.phone{
							height: 36rpx;
							font-size: 36rpx;
							flex: 1;
							margin-left: 40rpx;
						}
					}
					.note{
						width: 550rpx;
						margin: 20rpx 0 0;
						word-break: break-all;
						font-size: 22rpx;
						color: #a5977a;
					}
					.btn{
						margin: 20rpx 0 32rpx;
						width: 552rpx;
						height: 72rpx;
					}
				}
			}
			.pro_tt{
				margin-top: 40rpx;
				width: 626rpx;
				image{
					width: 201rpx;
					height: 33rpx;
				}
			}
			.project{
				width: 100%;
				display: -webkit-box;
				overflow: scroll;
				&::-webkit-scrollbar {
					display: none;
				}
				.item:first-child{
					margin-left: 20rpx;
				}
				.item:last-child{
					margin-right: 20rpx;
				}
				.item{
					display: flex;
					flex-direction: column;
					margin-bottom: 35rpx;
					margin-right: 30rpx;
					.img{
						margin-top: 30rpx;
						width: 240rpx;
						height: 148rpx;
						border-radius: 8rpx;
						background: #EFEFF4;
					}
					.name{
						font-size: 24rpx;
						font-weight: bold;
						color: #e6ddc2;
						margin-top: 20rpx;
					}
					.desc{
						font-size: 20rpx;
						color: #c7b786;
						margin-top: 15rpx;
					}
					.price{
						font-size: 20rpx;
						color: #c7b786;
						margin-top: 10rpx;
						.large{
							font-size: 22rpx;
							font-weight: bold;
							margin-left: 5rpx;
						}
					}
				}
			}
		}
		.down{
			margin: 40rpx;
			width: 670rpx;
			height: 276rpx;
		}
	}
	
    
</style>
